package com.peopledelete.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peopledelete.mapper.UserMapper;
import com.peopledelete.pojo.User;
import com.peopledelete.service.UserService;

/**
 * @author cyt
 * @create 2020-04-19 18:19
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    UserMapper userMapper;

    public boolean login(String name, String pwd) {
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("username", name);
        wrapper.eq("password", pwd);
        User user = userMapper.selectOne(wrapper);
        if (user != null) return true;
        else return false;
    }
}
